import send
import time

DB_File = "D:\PythonProject\qywx\db.txt"
file = open(DB_File, mode='r', encoding='utf-8')
line = file.readlines()

def run_send(send_time, send_number):
    number = 0
    a = 0
    while a < len(line):

        a = a + 1
        if a == len(line):
            a = 0

        massage_test = line[a - 1]
        send.send(massage_test)
        time.sleep(int(send_time))
        number = number + 1
        if number == int(send_number):
            break

    file.close()
